package com.sali.b_design_pattern.e_template_pattern.lesson_entity_wrapper.optimize;

/**
 * @description:
 * @author: sali
 * @date: 2024/5/30 22:58.
 * @version: 1.0
 */


public abstract class UserTemplate<T> {

    public T process(Long startTime, Long endTime) {
        String result = logicCommon(startTime, endTime, getQuerySql());
        return mapResult(result);
    }

    private String logicCommon(Long startTime, Long endTime, String queryDiskUseSql) {
        return startTime + "-" + endTime + "-" + queryDiskUseSql;
    }

    protected abstract T mapResult(String result);

    protected abstract String getQuerySql();
}
